from common.base import Base,By

class LoginPage(Base):
    # TODO 输入--账号
    def input_username(self,username):
        self.find_element((By.NAME,'username')).send_keys(username)

    # TODO 输入--密码
    def input_password(self,password):
        self.find_element(('name','password')).send_keys(password)

    # TODO 勾选--保存登录信息
    def remember(self):
        self.click(('id','remember'))

    # TODO 点击--登录按钮
    def btn_lohin(self):
        self.click(('class name','loginbtn'))

if __name__ == '__main__':

    # TODO 请求--目标网址
    login = LoginPage('chrome')
    login.get('https://ecshop.test2.shopex123.com/user.php')

    # TODO 调用--执行测试用例
    login.input_username('胖豆芽')
    login.input_password('Cq646785211')
    login.remember()
    login.btn_lohin()
    login.quit()
